package com.concurrent.threadLocal;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-05-06 11:26
 */
public class RequestHolder {
    private final static ThreadLocal<Long> requestHolder = new ThreadLocal<>();

    public static void add(long id){
        requestHolder.set(id);
    }

    public static long getId(){
        return requestHolder.get();
    }

    public static void remove(){
        requestHolder.remove();
    }
}
